package entity;

public class Teacher {
    private String teacherId; // 教师编号
    private String teacherName; // 教师姓名
    private String gender; // 性别
    private Course taughtCourse; // 教授的课程

    // 构造方法：初始化教师信息
    public Teacher(String teacherId, String teacherName, String gender) {
        this.teacherId = teacherId;
        this.teacherName = teacherName;
        this.gender = gender;
    }

    // 设置和获取教授的课程
    public void setTaughtCourse(Course taughtCourse) {
        this.taughtCourse = taughtCourse;
    }
    public Course getTaughtCourse() {
        return taughtCourse;
    }

    // 获取教师编号、姓名、性别
    public String getTeacherId() {
        return teacherId;
    }
    public String getTeacherName() {
        return teacherName;
    }
    public String getGender() {
        return gender;
    }

    // 打印教师信息时显示的内容
    @Override
    public String toString() {
        return "Teacher{" +
                "教师编号='" + teacherId + '\'' +
                ", 教师姓名='" + teacherName + '\'' +
                ", 性别='" + gender + '\'' +
                ", 教授课程=" + taughtCourse +
                '}';
    }
}